<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<title></title>
		<link rel="stylesheet" type="text/css" href="../css/main.css" /> 
		<link rel="stylesheet" type="text/css" href="../css/index.css" />
		<!-- 引入组件 -->
		<script src="../js/vue.js" type="text/javascript" charset="utf-8"></script>
		<script src="../js/vant.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body>
		<div id="app">
			<header>
				<van-nav-bar title="新增收货地址" left-text="返回" @click-left="onClickLeft" left-arrow>
					<!-- <van-icon name="search" slot="right"></van-icon> -->
				</van-nav-bar>

			</header>
			<section>
				<van-address-edit :area-list="areaList" show-delete show-set-default show-search-result :search-result="searchResul"
				 @save="onSave" @delete="onDelete" @change-detail="onChangeDetail">
				</van-address-edit>
			</section>
			<footer></footer>
		</div>
		<script>
			var vm = new Vue({
				el: "#app",
				data: {
					areaList: "",
					searchResul: []
				},
				methods: {
					onSave() {
						Toast('save');
					},
					onDelete() {
						Toast('delete');
					},
					onChangeDetail(val) {
						if (val) {
							this.searchResult = [{
								name: '黄龙万科中心',
								address: '杭州市西湖区'
							}];
						} else {
							this.searchResult = [];
						}
					},
					onClickLeft() {
						var gin = plus.webview.create("/views/setting.html", "dd");
						gin.show();
						plus.webview.close(plus.webview.currentWebview());
					},
					onClickRight() {
						Toast('按钮');
					}
				}
			})
		</script>
	</body>
</html>
